<extend name="Public/user"/>
<block name="user-right">
	<script src="__JS__/jquery-1.9.1.min.js" type="text/javascript"></script>
	<script type="text/javascript" src="__STATIC__/thinkbox/thinkbox/jquery.thinkbox.js"></script>
	<script type="text/javascript" src="__JS__/style.js"></script>
	<!-- 页面header钩子，一般用于加载插件CSS文件和代码 -->
	{:hook('pageHeader')}
	<!--main_right-->
	<div class="main_r f_fr">
		<div class="user_kx">
			<h3 class="user_kx_title">
				我的信息

			</h3>
		</div>

		<div class="user_kx">

			<!-- Nav tabs -->
			<ul class="nav nav-tabs" role="tablist">
				<li role="presentation"   class="<eq name="type" value="liuyan">active</eq>"><a href="{:url('User/msg','type=liuyan')}" >{:lang('my_message')}</a></li>
				<li role="presentation" class="<eq name="type" value="notice">active</eq>"><a href="{:url('User/msg','type=notice')}" >{:lang('system_notice')}</a></li>
			</ul>

			<!-- Tab panes -->
			<div class="tab-content">
				<div role="tabpanel" class="tab-pane active" id="home">
					<div  class="ta_c" style="padding:20px;">
						<a href="###" class="btn btn-default red c-w w150 liuyan" >{:lang('add_msg')}</a>
					</div>
					<table class="table table-striped table-bordered">

						<tbody>
						<tr >

							<th class="w200 ta_c">{:lang('add_time')}</th>

							<th class="ta_c">{:lang('message_info')}</th>

						</tr>
						<if condition="$list">
							<volist name="list" id="v">
								<tr>
									<td>{$v.add_time|time_format}</td>
									<td><notempty name='v.title'>【{$v.title}】</notempty>{$v.content}<if condition="$v.reply neq ''"><i style="display: block;color: red;">{:lang('reply')}：{$v.reply} ({$v.reply_time|date="Y-m-d",###})</i></if></td>
								</tr>
							</volist>
						<else/>
							<tr>
								<td colspan="2">{:lang('no_infos')}</td>
							</tr>
						</if>
						</tbody>


					</table>
					<div>
						{$_page}

					</div>
					<div id="liuyanform" style="display: none;">
						<form action="{:url('User/liuyanadd')}" methon="post">
							<textarea name="content" style="height: 80px;width: 300px;padding: 5px;" placeholder="{:lang('write_msg')}"></textarea>
							<div style="text-align: right;"><button>{:lang('submit_msg')}</button></div>
						</form>
					</div>
			   </div>


			</div>

		</div>
	</div>
</block>
<block name="javascript">
	<script type="text/javascript">
		$(function(){
			$('.liuyan').click(function(){
				$.thinkbox('#liuyanform',{'title':'Add Message','dataEle':this,'modal':true,'drag':true});
			})
			$('form').submit(function(){
				var self = $(this);
				$.post(self.attr("action"), self.serialize(), success, "json");
				return false;
				function success(data){
					if (data.status) {
						$.thinkbox.success(data.info);
						setTimeout(jumpurl(data.url),1500);
					}else{
						$.thinkbox.error(data.info);
					};
				}
			})
		})
	</script>
</block>